package StandardIOTest;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;

/**
 * @author 李泽伟
 */
public class MainTest {
    public static void main(String[] args) {
        PrintStream ps = null;
        try {
            FileOutputStream stream = new FileOutputStream("print.txt");
            ps = new PrintStream(stream);
            if (ps!=null){
                System.setOut(ps);
            }
            for (int i = 0; i < 256; i++){
                System.out.print((char) i);
                if(i%50==0){
                    System.out.println();
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (ps != null) {
                ps.close();
            }
        }
    }
}
